<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>快享钱包后台管理系统</title>
<meta name="author" content="DeathGhost" />
<link rel="icon" href="__RESOURCE__images/icon/title.jpg" type="image/x-icon">
<link rel="stylesheet" type="text/css" href="__RESOURCE__css/style.css" />
<style>
body{height:100%;background:#16a085;overflow:hidden;}
canvas{z-index:-1;position:absolute;}

.yzm{
	    vertical-align: middle;
    border: 0;
    position: absolute;
    height: 42px;
    margin: 0px;
   
    text-align: center;
    line-height: 32px;
 
    cursor: pointer;
}
</style>
<script src="__RESOURCE__js/jquery.js"></script>
<script src="__RESOURCE__js/verificationNumbers.js"></script>
<script src="__RESOURCE__js/Particleground.js"></script>
<script>
$(document).ready(function() {
  //粒子背景特效
  $('body').particleground({
    dotColor: '#5cbdaa',
    lineColor: '#5cbdaa'
  });
  //验证码
  	var captcha_img = $("#imgcode");
	var verifyimg = captcha_img.attr("src");  
	captcha_img.attr('title', '点击刷新');
	captcha_img.click(function(){  
	    if( verifyimg.indexOf('?')>0){  
	        $(this).attr("src", verifyimg+'&random='+Math.random());  
	    }else{  
	        $(this).attr("src", verifyimg.replace(/\?.*$/,'')+'?'+Math.random());  
	    }  
	});
	
	
});
</script>
</head>
<body>
<form id="form2">
<dl class="admin_login">
 <dt>
  <strong>快享钱包后台管理系统</strong>
  <em>Management System</em>
 </dt>
 <dd class="user_icon">
  <input type="text" name="TxtUserName" id="TxtUserName" placeholder="账号" class="login_txtbx"/>
 </dd>
 <dd class="pwd_icon">
  <input type="password" name="TxtUserPass"  id="TxtUserPass" placeholder="密码" class="login_txtbx"/>
 </dd>
 <dd class="val_icon">
  <div class="checkcode">
    <input type="text" name="TxtCheckCode" id="TxtCheckCode" placeholder="验证码" maxlength="4" class="login_txtbx">
   <img id="imgcode" class="yzm" alt="验证码" src="{:U('Dyadmin/Login/verify_code',array())}"  width=85 height=36  title="点击刷新" />
  </div>
  <input type="button" value="验证码核验" class="ver_btn">
 </dd>
 <dd>
  <input type="button" value="立即登录" class="submit_btn" onclick="IbtnEnter_onclick()"/>
 </dd>
 <dd>
  <p>© 2017-2019 {$soft_copyright}版权所有</p>
  <p>粤ICP备16057790号-1</p>
 </dd>
</dl>
</form>
</body>
</html>
<script type='text/javascript'>

function IbtnEnter_onclick() {  
    checklogin();  
    return false;  
}  

function checklogin() {  
  
    if ($("#TxtUserName").val() == "" ) {  
       alert("提示：用户名必须填写！");  
        $("#TxtUserName").focus();  
        return false;  
    }  
    else{  
     
    }  

    if ($("#TxtUserPass").val() == "" ) {  
       alert("提示：密码必须填写！");  
        $("#TxtUserPass").focus();  
        return false;  
    }  
    else{  
      
    }  
      
    if ($("#TxtCheckCode").val() == "") {  
       alert("提示：验证码必须填写！");  
        $("#TxtCheckCode").focus();  
        return false;  
    }  
    else{  
    
    }  

    $.ajax({  
        type: "POST",  
        url: "{:U('Dyadmin/login/chkLogin')}",
        dataType:'json',
        data : $('#form2').serialize(),    
        success: function (data) { 
        	
            if (data.status == 'y') {
            	alert("登入成功");
                location.href = "{:U('Dyadmin/index/index')}";
                return true;  
            }  
            else {  
                alert("登入失败，"+data.info +"！");  
                $("#password").val("");  
                $("#verifycode").val("");  
            	$("#imgcode").attr('src',"{:U('Dyadmin/Login/verify_code')}?"+Math.random());
                $("#password").focus();  
                return false;  
            }  
        }  
    })  
}  

</script>  


